#ifndef VOLUMERENDERCONTROL_H
#define VOLUMERENDERCONTROL_H

#include <QWidget>
#include "ui_volumerendercontrol.h"
#include "../ColorTable/ColorTable.h"

namespace PBVP {
	class VolumeRenderer;
	class GeometryDataNode;
	///
	class VolumeRenderControl : public QWidget
	{
		Q_OBJECT

	public:
		/// 
		VolumeRenderControl(VolumeRenderer *pRenderer, QWidget *parent = 0);
		///
		~VolumeRenderControl();

	public slots:
		/// Update color map of the renderer
		void updateColorMap();

		/// Add an isocontour node
		void addIsoContour(int index, double isovalue, double R, double G, double B);

		/// Update an isocontour node
		void updateIsoContour(int index, double isovalue, double R, double G, double B);

		/// Delete an isocontour node
		void deleteIsoContour(int index);

		/// Load a colormap from a file
		void loadColorMap(int index);

		///
		void loadMapFiles();

		///
		void setMinMaxLabels(float fmin, float fmax);

	private:
		Ui::VolumeRenderControlClass ui;

		int m_MapSize;

		VolumeRenderer *m_pVolRenderer;
		ColorTable *m_pColorTable;

		/// We now only allow one isocontour node
		GeometryDataNode *m_pContour;

		///
		void getColorMapUC(unsigned char ucArray[], int size);

	};
}
#endif // VOLUMERENDERCONTROL_H
